<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="language" content="en" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<link rel="stylesheet" type="text/css" href="css/api.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<title>COutputCache</title>
</head>

<body>
<div id="apiPage">

<div id="apiHeader">
<a href="http://www.yiiframework.com">Yii Framework</a> v1.1.17 Class Reference
</div><!-- end of header -->

<div id="content">
<h1>COutputCache</h1>
<div id="nav">
<a href="index.html">All Packages</a>
| <a href="#properties">Properties</a>
| <a href="#methods">Methods</a>
</div>

<table class="summaryTable docClass">
<colgroup>
	<col class="col-name" />
	<col class="col-value" />
</colgroup>
<tr>
  <th>Package</th>
  <td><a href="index.html#system.web.widgets">system.web.widgets</a></td>
</tr>
<tr>
  <th>Inheritance</th>
  <td>class COutputCache &raquo;
<a href="CFilterWidget.html">CFilterWidget</a> &raquo;
<a href="CWidget.html">CWidget</a> &raquo;
<a href="CBaseController.html">CBaseController</a> &raquo;
<a href="CComponent.html">CComponent</a></td>
</tr>
<tr>
  <th>Implements</th>
  <td><a href="IFilter.html">IFilter</a></td>
</tr>
<tr>
  <th>Since</th>
  <td>1.0</td>
</tr>
<tr>
  <th>Source Code</th>
  <td><a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php">framework/web/widgets/COutputCache.php</a></td>
</tr>
</table>

<div id="classDescription">
COutputCache enables caching the output generated by an action or a view fragment.
<br/><br/>
If the output to be displayed is found valid in cache, the cached
version will be displayed instead, which saves the time for generating
the original output.
<br/><br/>
Since COutputCache extends from <a href="CFilterWidget.html">CFilterWidget</a>, it can be used
as either a filter (for action caching) or a widget (for fragment caching).
For the latter, the shortcuts <a href="CBaseController.html#beginCache">CBaseController::beginCache()</a> and <a href="CBaseController.html#endCache">CBaseController::endCache()</a>
are often used instead, like the following in a view file:
<pre>
if($this-&gt;beginCache('cacheName',array('property1'=&gt;'value1',...))
{
    // ... display the content to be cached here
   $this-&gt;endCache();
}
</pre>
<br/><br/>
COutputCache must work with a cache application component specified via <a href="COutputCache.html#cacheID">cacheID</a>.
If the cache application component is not available, COutputCache will be disabled.
<br/><br/>
The validity of the cached content is determined based on two factors:
the <a href="COutputCache.html#duration">duration</a> and the cache <a href="COutputCache.html#dependency">dependency</a>.
The former specifies the number of seconds that the data can remain
valid in cache (defaults to 60s), while the latter specifies conditions
that the cached data depends on. If a dependency changes,
(e.g. relevant data in DB are updated), the cached data will be invalidated.
For more details about cache dependency, see <a href="CCacheDependency.html">CCacheDependency</a>.
<br/><br/>
Sometimes, it is necessary to turn off output caching only for certain request types.
For example, we only want to cache a form when it is initially requested;
any subsequent display of the form should not be cached because it contains user input.
We can set <a href="COutputCache.html#requestTypes">requestTypes</a> to be <code>array('GET')</code> to accomplish this task.
<br/><br/>
The content fetched from cache may be variated with respect to
some parameters. COutputCache supports four kinds of variations:
<ul>
<li><a href="COutputCache.html#varyByRoute">varyByRoute</a>: this specifies whether the cached content
  should be varied with the requested route (controller and action)</li>
<li><a href="COutputCache.html#varyByParam">varyByParam</a>: this specifies a list of GET parameter names
  and uses the corresponding values to determine the version of the cached content.</li>
<li><a href="COutputCache.html#varyBySession">varyBySession</a>: this specifies whether the cached content
  should be varied with the user session.</li>
<li><a href="COutputCache.html#varyByExpression">varyByExpression</a>: this specifies whether the cached content
  should be varied with the result of the specified PHP expression.</li>
<li><a href="COutputCache.html#varyByLanguage">varyByLanguage</a>: this specifies whether the cached content
  should by varied with the user's language. Available since 1.1.14.</li>
</ul>
For more advanced variation, override <a href="COutputCache.html#getBaseCacheKey">getBaseCacheKey()</a> method.</div>
<a name="properties"></a>

<div class="summary docProperty">
<h2>Public Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="actionPrefix">
  <td><a href="CWidget.html#actionPrefix-detail">actionPrefix</a></td>
  <td>string</td>
  <td>the prefix to the IDs of the <a href="COutputCache.html#actions">actions</a>.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="cacheID">
  <td><a href="COutputCache.html#cacheID-detail">cacheID</a></td>
  <td>string</td>
  <td>the ID of the cache application component.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="controller">
  <td><a href="CWidget.html#controller-detail">controller</a></td>
  <td><a href="CController.html">CController</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="dependency">
  <td><a href="COutputCache.html#dependency-detail">dependency</a></td>
  <td>mixed</td>
  <td>the dependency that the cached content depends on.</td>
  <td>COutputCache</td>
</tr>
<tr id="duration">
  <td><a href="COutputCache.html#duration-detail">duration</a></td>
  <td>integer</td>
  <td>number of seconds that the data can remain in cache.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="id">
  <td><a href="CWidget.html#id-detail">id</a></td>
  <td>string</td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="isContentCached">
  <td><a href="COutputCache.html#isContentCached-detail">isContentCached</a></td>
  <td>boolean</td>
  <td>whether the content can be found from cache</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="isFilter">
  <td><a href="CFilterWidget.html#isFilter-detail">isFilter</a></td>
  <td>boolean</td>
  <td>whether this widget is used as a filter.</td>
  <td><a href="CFilterWidget.html">CFilterWidget</a></td>
</tr>
<tr class="inherited" id="owner">
  <td><a href="CWidget.html#owner-detail">owner</a></td>
  <td><a href="CBaseController.html">CBaseController</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="requestTypes">
  <td><a href="COutputCache.html#requestTypes-detail">requestTypes</a></td>
  <td>array</td>
  <td>list of request types (e.g. GET, POST) for which the cache should be enabled only.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="skin">
  <td><a href="CWidget.html#skin-detail">skin</a></td>
  <td>mixed</td>
  <td>the name of the skin to be used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="stopAction">
  <td><a href="CFilterWidget.html#stopAction-detail">stopAction</a></td>
  <td>boolean</td>
  <td>whether to stop the action execution when this widget is used as a filter.</td>
  <td><a href="CFilterWidget.html">CFilterWidget</a></td>
</tr>
<tr id="varyByExpression">
  <td><a href="COutputCache.html#varyByExpression-detail">varyByExpression</a></td>
  <td>string</td>
  <td>a PHP expression whose result is used in the cache key calculation.</td>
  <td>COutputCache</td>
</tr>
<tr id="varyByLanguage">
  <td><a href="COutputCache.html#varyByLanguage-detail">varyByLanguage</a></td>
  <td>boolean</td>
  <td>whether the content being cached should be differentiated according to user's language.</td>
  <td>COutputCache</td>
</tr>
<tr id="varyByParam">
  <td><a href="COutputCache.html#varyByParam-detail">varyByParam</a></td>
  <td>array</td>
  <td>list of GET parameters that should participate in cache key calculation.</td>
  <td>COutputCache</td>
</tr>
<tr id="varyByRoute">
  <td><a href="COutputCache.html#varyByRoute-detail">varyByRoute</a></td>
  <td>boolean</td>
  <td>whether the content being cached should be differentiated according to route.</td>
  <td>COutputCache</td>
</tr>
<tr id="varyBySession">
  <td><a href="COutputCache.html#varyBySession-detail">varyBySession</a></td>
  <td>boolean</td>
  <td>whether the content being cached should be differentiated according to user sessions.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="viewPath">
  <td><a href="CWidget.html#viewPath-detail">viewPath</a></td>
  <td>string</td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
</table>
</div>
<div class="summary docProperty">
<h2>Protected Properties</h2>

<p><a href="#" class="toggle">Hide inherited properties</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-property" />
	<col class="col-type" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Property</th><th>Type</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="baseCacheKey">
  <td><a href="COutputCache.html#baseCacheKey-detail">baseCacheKey</a></td>
  <td>string</td>
  <td>Caclulates the base cache key.</td>
  <td>COutputCache</td>
</tr>
<tr id="cache">
  <td><a href="COutputCache.html#cache-detail">cache</a></td>
  <td><a href="ICache.html">ICache</a></td>
  <td>the cache used for caching the content.</td>
  <td>COutputCache</td>
</tr>
<tr id="cacheKey">
  <td><a href="COutputCache.html#cacheKey-detail">cacheKey</a></td>
  <td>string</td>
  <td>Calculates the cache key.</td>
  <td>COutputCache</td>
</tr>
</table>
</div>
<a name="methods"></a>

<div class="summary docMethod">
<h2>Public Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr class="inherited" id="__call">
  <td><a href="CComponent.html#__call-detail">__call()</a></td>
  <td>Calls the named method which is not a class method.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__construct">
  <td><a href="CFilterWidget.html#__construct-detail">__construct()</a></td>
  <td>Constructor.</td>
  <td><a href="CFilterWidget.html">CFilterWidget</a></td>
</tr>
<tr class="inherited" id="__get">
  <td><a href="CComponent.html#__get-detail">__get()</a></td>
  <td>Returns a property value, an event handler list or a behavior based on its name.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__isset">
  <td><a href="CComponent.html#__isset-detail">__isset()</a></td>
  <td>Checks if a property value is null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__set">
  <td><a href="CComponent.html#__set-detail">__set()</a></td>
  <td>Sets value of a component property.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="__unset">
  <td><a href="CComponent.html#__unset-detail">__unset()</a></td>
  <td>Sets a component property to be null.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="actions">
  <td><a href="CWidget.html#actions-detail">actions()</a></td>
  <td>Returns a list of actions that are used by this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="asa">
  <td><a href="CComponent.html#asa-detail">asa()</a></td>
  <td>Returns the named behavior object.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehavior">
  <td><a href="CComponent.html#attachBehavior-detail">attachBehavior()</a></td>
  <td>Attaches a behavior to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachBehaviors">
  <td><a href="CComponent.html#attachBehaviors-detail">attachBehaviors()</a></td>
  <td>Attaches a list of behaviors to the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="attachEventHandler">
  <td><a href="CComponent.html#attachEventHandler-detail">attachEventHandler()</a></td>
  <td>Attaches an event handler to an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="beginCache">
  <td><a href="CBaseController.html#beginCache-detail">beginCache()</a></td>
  <td>Begins fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginClip">
  <td><a href="CBaseController.html#beginClip-detail">beginClip()</a></td>
  <td>Begins recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginContent">
  <td><a href="CBaseController.html#beginContent-detail">beginContent()</a></td>
  <td>Begins the rendering of content that is to be decorated by the specified view.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="beginWidget">
  <td><a href="CBaseController.html#beginWidget-detail">beginWidget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="canGetProperty">
  <td><a href="CComponent.html#canGetProperty-detail">canGetProperty()</a></td>
  <td>Determines whether a property can be read.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="canSetProperty">
  <td><a href="CComponent.html#canSetProperty-detail">canSetProperty()</a></td>
  <td>Determines whether a property can be set.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="createWidget">
  <td><a href="CBaseController.html#createWidget-detail">createWidget()</a></td>
  <td>Creates a widget and initializes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="detachBehavior">
  <td><a href="CComponent.html#detachBehavior-detail">detachBehavior()</a></td>
  <td>Detaches a behavior from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachBehaviors">
  <td><a href="CComponent.html#detachBehaviors-detail">detachBehaviors()</a></td>
  <td>Detaches all behaviors from the component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="detachEventHandler">
  <td><a href="CComponent.html#detachEventHandler-detail">detachEventHandler()</a></td>
  <td>Detaches an existing event handler.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehavior">
  <td><a href="CComponent.html#disableBehavior-detail">disableBehavior()</a></td>
  <td>Disables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="disableBehaviors">
  <td><a href="CComponent.html#disableBehaviors-detail">disableBehaviors()</a></td>
  <td>Disables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehavior">
  <td><a href="CComponent.html#enableBehavior-detail">enableBehavior()</a></td>
  <td>Enables an attached behavior.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="enableBehaviors">
  <td><a href="CComponent.html#enableBehaviors-detail">enableBehaviors()</a></td>
  <td>Enables all behaviors attached to this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="endCache">
  <td><a href="CBaseController.html#endCache-detail">endCache()</a></td>
  <td>Ends fragment caching.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endClip">
  <td><a href="CBaseController.html#endClip-detail">endClip()</a></td>
  <td>Ends recording a clip.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endContent">
  <td><a href="CBaseController.html#endContent-detail">endContent()</a></td>
  <td>Ends the rendering of content.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="endWidget">
  <td><a href="CBaseController.html#endWidget-detail">endWidget()</a></td>
  <td>Ends the execution of the named widget.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="evaluateExpression">
  <td><a href="CComponent.html#evaluateExpression-detail">evaluateExpression()</a></td>
  <td>Evaluates a PHP expression or callback under the context of this component.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="filter">
  <td><a href="COutputCache.html#filter-detail">filter()</a></td>
  <td>Performs filtering before the action is executed.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="getController">
  <td><a href="CWidget.html#getController-detail">getController()</a></td>
  <td>Returns the controller that this widget belongs to.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getEventHandlers">
  <td><a href="CComponent.html#getEventHandlers-detail">getEventHandlers()</a></td>
  <td>Returns the list of attached event handlers for an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="getId">
  <td><a href="CWidget.html#getId-detail">getId()</a></td>
  <td>Returns the ID of the widget or generates a new one if requested.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr id="getIsContentCached">
  <td><a href="COutputCache.html#getIsContentCached-detail">getIsContentCached()</a></td>
  <td>Checks whether the content can be found from cache</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="getIsFilter">
  <td><a href="CFilterWidget.html#getIsFilter-detail">getIsFilter()</a></td>
  <td>Checks whether this widget is used as a filter.</td>
  <td><a href="CFilterWidget.html">CFilterWidget</a></td>
</tr>
<tr class="inherited" id="getOwner">
  <td><a href="CWidget.html#getOwner-detail">getOwner()</a></td>
  <td>Returns the owner/creator of this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewFile">
  <td><a href="CWidget.html#getViewFile-detail">getViewFile()</a></td>
  <td>Looks for the view script file according to the view name.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="getViewPath">
  <td><a href="CWidget.html#getViewPath-detail">getViewPath()</a></td>
  <td>Returns the directory containing the view files for this widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="hasEvent">
  <td><a href="CComponent.html#hasEvent-detail">hasEvent()</a></td>
  <td>Determines whether an event is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasEventHandler">
  <td><a href="CComponent.html#hasEventHandler-detail">hasEventHandler()</a></td>
  <td>Checks whether the named event has attached handlers.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr class="inherited" id="hasProperty">
  <td><a href="CComponent.html#hasProperty-detail">hasProperty()</a></td>
  <td>Determines whether a property is defined.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="init">
  <td><a href="COutputCache.html#init-detail">init()</a></td>
  <td>Marks the start of content to be cached.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="raiseEvent">
  <td><a href="CComponent.html#raiseEvent-detail">raiseEvent()</a></td>
  <td>Raises an event.</td>
  <td><a href="CComponent.html">CComponent</a></td>
</tr>
<tr id="recordAction">
  <td><a href="COutputCache.html#recordAction-detail">recordAction()</a></td>
  <td>Records a method call when this output cache is in effect.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="render">
  <td><a href="CWidget.html#render-detail">render()</a></td>
  <td>Renders a view.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="renderFile">
  <td><a href="CBaseController.html#renderFile-detail">renderFile()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr class="inherited" id="renderInternal">
  <td><a href="CBaseController.html#renderInternal-detail">renderInternal()</a></td>
  <td>Renders a view file.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
<tr id="run">
  <td><a href="COutputCache.html#run-detail">run()</a></td>
  <td>Marks the end of content to be cached.</td>
  <td>COutputCache</td>
</tr>
<tr class="inherited" id="setId">
  <td><a href="CWidget.html#setId-detail">setId()</a></td>
  <td>Sets the ID of the widget.</td>
  <td><a href="CWidget.html">CWidget</a></td>
</tr>
<tr class="inherited" id="widget">
  <td><a href="CBaseController.html#widget-detail">widget()</a></td>
  <td>Creates a widget and executes it.</td>
  <td><a href="CBaseController.html">CBaseController</a></td>
</tr>
</table>
</div>
<div class="summary docMethod">
<h2>Protected Methods</h2>

<p><a href="#" class="toggle">Hide inherited methods</a></p>

<table class="summaryTable">
<colgroup>
	<col class="col-method" />
	<col class="col-description" />
	<col class="col-defined" />
</colgroup>
<tr>
  <th>Method</th><th>Description</th><th>Defined By</th>
</tr>
<tr id="checkContentCache">
  <td><a href="COutputCache.html#checkContentCache-detail">checkContentCache()</a></td>
  <td>Looks for content in cache.</td>
  <td>COutputCache</td>
</tr>
<tr id="getBaseCacheKey">
  <td><a href="COutputCache.html#getBaseCacheKey-detail">getBaseCacheKey()</a></td>
  <td>Caclulates the base cache key.</td>
  <td>COutputCache</td>
</tr>
<tr id="getCache">
  <td><a href="COutputCache.html#getCache-detail">getCache()</a></td>
  <td>Returns the cache used for caching the content.</td>
  <td>COutputCache</td>
</tr>
<tr id="getCacheKey">
  <td><a href="COutputCache.html#getCacheKey-detail">getCacheKey()</a></td>
  <td>Calculates the cache key.</td>
  <td>COutputCache</td>
</tr>
<tr id="replayActions">
  <td><a href="COutputCache.html#replayActions-detail">replayActions()</a></td>
  <td>Replays the recorded method calls.</td>
  <td>COutputCache</td>
</tr>
</table>
</div>
<a name="events"></a>

<h2>Property Details</h2>
<div class="detailHeader" id="baseCacheKey-detail">
baseCacheKey<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
protected string <a href="COutputCache.html#getBaseCacheKey"><b>getBaseCacheKey</b></a>()</div>

<p>Caclulates the base cache key.
The calculated key will be further variated in <a href="COutputCache.html#getCacheKey">getCacheKey</a>.
Derived classes may override this method if more variations are needed.</p>


<div class="detailHeader" id="cache-detail">
cache<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
protected <a href="ICache.html">ICache</a> <a href="COutputCache.html#getCache"><b>getCache</b></a>()</div>

<p>the cache used for caching the content.</p>


<div class="detailHeader" id="cacheID-detail">
cacheID<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$cacheID</b>;</div>

<p>the ID of the cache application component. Defaults to 'cache' (the primary cache application component.)</p>


<div class="detailHeader" id="cacheKey-detail">
cacheKey<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
protected string <a href="COutputCache.html#getCacheKey"><b>getCacheKey</b></a>()</div>

<p>Calculates the cache key.
The key is calculated based on <a href="COutputCache.html#getBaseCacheKey">getBaseCacheKey</a> and other factors, including
<a href="COutputCache.html#varyByRoute">varyByRoute</a>, <a href="COutputCache.html#varyByParam">varyByParam</a>, <a href="COutputCache.html#varyBySession">varyBySession</a> and <a href="COutputCache.html#varyByLanguage">varyByLanguage</a>.</p>


<div class="detailHeader" id="dependency-detail">
dependency<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public mixed <b>$dependency</b>;</div>

<p>the dependency that the cached content depends on.
This can be either an object implementing <a href="ICacheDependency.html">ICacheDependency</a> interface or an array
specifying the configuration of the dependency object. For example,
<pre>
array(
    'class'=&gt;'CDbCacheDependency',
    'sql'=&gt;'SELECT MAX(lastModified) FROM Post',
)
</pre>
would make the output cache depends on the last modified time of all posts.
If any post has its modification time changed, the cached content would be invalidated.</p>


<div class="detailHeader" id="duration-detail">
duration<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public integer <b>$duration</b>;</div>

<p>number of seconds that the data can remain in cache. Defaults to 60 seconds.
If it is 0, existing cached content would be removed from the cache.
If it is a negative value, the cache will be disabled (any existing cached content will
remain in the cache.)
<br/><br/>
Note, if cache dependency changes or cache space is limited,
the data may be purged out of cache earlier.</p>


<div class="detailHeader" id="isContentCached-detail">
isContentCached<span class="detailHeaderTag">
property
 <em>read-only</em> </span>
</div>

<div class="signature">
public boolean <a href="COutputCache.html#getIsContentCached"><b>getIsContentCached</b></a>()</div>

<p>whether the content can be found from cache</p>


<div class="detailHeader" id="requestTypes-detail">
requestTypes<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$requestTypes</b>;</div>

<p>list of request types (e.g. GET, POST) for which the cache should be enabled only.
Defaults to null, meaning all request types.</p>


<div class="detailHeader" id="varyByExpression-detail">
varyByExpression<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public string <b>$varyByExpression</b>;</div>

<p>a PHP expression whose result is used in the cache key calculation.
By setting this property, the output cache will use different cached data
for each different expression result.
The expression can also be a valid PHP callback,
including class method name (array(ClassName/Object, MethodName)),
or anonymous function (PHP 5.3.0+). The function/method signature should be as follows:
<pre>
function foo($cache) { ... }
</pre>
where $cache refers to the output cache component.
<br/><br/>
The PHP expression will be evaluated using <a href="COutputCache.html#evaluateExpression">evaluateExpression</a>.
<br/><br/>
A PHP expression can be any PHP code that has a value. To learn more about what an expression is,
please refer to the <a href="http://www.php.net/manual/en/language.expressions.php">php manual</a>.</p>


<div class="detailHeader" id="varyByLanguage-detail">
varyByLanguage<span class="detailHeaderTag">
property
 (available since v1.1.14)
</span>
</div>

<div class="signature">
public boolean <b>$varyByLanguage</b>;</div>

<p>whether the content being cached should be differentiated according to user's language.
A language is retrieved via Yii::app()->language.
Defaults to false.</p>


<div class="detailHeader" id="varyByParam-detail">
varyByParam<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public array <b>$varyByParam</b>;</div>

<p>list of GET parameters that should participate in cache key calculation.
By setting this property, the output cache will use different cached data
for each different set of GET parameter values.</p>


<div class="detailHeader" id="varyByRoute-detail">
varyByRoute<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$varyByRoute</b>;</div>

<p>whether the content being cached should be differentiated according to route.
A route consists of the requested controller ID and action ID.
Defaults to true.</p>


<div class="detailHeader" id="varyBySession-detail">
varyBySession<span class="detailHeaderTag">
property
</span>
</div>

<div class="signature">
public boolean <b>$varyBySession</b>;</div>

<p>whether the content being cached should be differentiated according to user sessions. Defaults to false.</p>


<h2>Method Details</h2>

<div class="detailHeader" id="checkContentCache-detail">
checkContentCache()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected boolean <b>checkContentCache</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">boolean</td>
  <td class="paramDescCol">whether the content is found in cache.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L233">framework/web/widgets/COutputCache.php#233</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">checkContentCache</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if((empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">requestTypes</span><span style="color: #007700">)&nbsp;||&nbsp;</span><span style="color: #0000BB">in_array</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getRequest</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getRequestType</span><span style="color: #007700">(),</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">requestTypes</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCache</span><span style="color: #007700">())!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">duration</span><span style="color: #007700">&gt;</span><span style="color: #0000BB">0&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;(</span><span style="color: #0000BB">$data</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">get</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCacheKey</span><span style="color: #007700">()))!==</span><span style="color: #0000BB">false</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">=</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_actions</span><span style="color: #007700">=</span><span style="color: #0000BB">$data</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">true</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">duration</span><span style="color: #007700">==</span><span style="color: #0000BB">0</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">delete</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCacheKey</span><span style="color: #007700">());<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">duration</span><span style="color: #007700">&lt;=</span><span style="color: #0000BB">0</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">=</span><span style="color: #0000BB">null</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p>Looks for content in cache.</p>


<div class="detailHeader" id="filter-detail">
filter()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public boolean <b>filter</b>(<a href="CFilterChain.html">CFilterChain</a> $filterChain)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$filterChain</td>
  <td class="paramTypeCol"><a href="CFilterChain.html">CFilterChain</a></td>
  <td class="paramDescCol">list of filters being applied to an action</td>
</tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">boolean</td>
  <td class="paramDescCol">whether the filtering process should stop after this filter. Defaults to false.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L162">framework/web/widgets/COutputCache.php#162</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">filter</span><span style="color: #007700">(</span><span style="color: #0000BB">$filterChain</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(!</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getIsContentCached</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$filterChain</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">run</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p>Performs filtering before the action is executed.
This method is meant to be overridden by child classes if begin-filtering is needed.</p>


<div class="detailHeader" id="getBaseCacheKey-detail">
getBaseCacheKey()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected string <b>getBaseCacheKey</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">basic cache key without variations</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L266">framework/web/widgets/COutputCache.php#266</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">getBaseCacheKey</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">self</span><span style="color: #007700">::</span><span style="color: #0000BB">CACHE_KEY_PREFIX</span><span style="color: #007700">.</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">().</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br />}</span>
</span>
</code></div>
</div>
<p>Caclulates the base cache key.
The calculated key will be further variated in <a href="COutputCache.html#getCacheKey">getCacheKey</a>.
Derived classes may override this method if more variations are needed.</p>


<div class="detailHeader" id="getCache-detail">
getCache()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected <a href="ICache.html">ICache</a> <b>getCache</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol"><a href="ICache.html">ICache</a></td>
  <td class="paramDescCol">the cache used for caching the content.</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L255">framework/web/widgets/COutputCache.php#255</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">getCache</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getComponent</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">cacheID</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p></p>


<div class="detailHeader" id="getCacheKey-detail">
getCacheKey()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected string <b>getCacheKey</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">cache key</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L277">framework/web/widgets/COutputCache.php#277</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">getCacheKey</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_key</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_key</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getBaseCacheKey</span><span style="color: #007700">().</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByRoute</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$controller</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">$controller</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getUniqueId</span><span style="color: #007700">().</span><span style="color: #DD0000">'/'</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if((</span><span style="color: #0000BB">$action</span><span style="color: #007700">=</span><span style="color: #0000BB">$controller</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getAction</span><span style="color: #007700">())!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">$action</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getId</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyBySession</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getSession</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getSessionID</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByParam</span><span style="color: #007700">)&nbsp;&amp;&amp;&nbsp;isset(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByParam</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$params</span><span style="color: #007700">=array();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByParam&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$name</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(isset(</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$params</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]=</span><span style="color: #0000BB">$_GET</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$params</span><span style="color: #007700">[</span><span style="color: #0000BB">$name</span><span style="color: #007700">]=</span><span style="color: #DD0000">''</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">serialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$params</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByExpression</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">evaluateExpression</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByExpression</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">varyByLanguage</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">language</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$key</span><span style="color: #007700">.=</span><span style="color: #DD0000">'.'</span><span style="color: #007700">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_key</span><span style="color: #007700">=</span><span style="color: #0000BB">$key</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Calculates the cache key.
The key is calculated based on <a href="COutputCache.html#getBaseCacheKey">getBaseCacheKey</a> and other factors, including
<a href="COutputCache.html#varyByRoute">varyByRoute</a>, <a href="COutputCache.html#varyByParam">varyByParam</a>, <a href="COutputCache.html#varyBySession">varyBySession</a> and <a href="COutputCache.html#varyByLanguage">varyByLanguage</a>.</p>


<div class="detailHeader" id="getIsContentCached-detail">
getIsContentCached()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public boolean <b>getIsContentCached</b>()</div>
</td></tr>
<tr>
  <td class="paramNameCol">{return}</td>
  <td class="paramTypeCol">boolean</td>
  <td class="paramDescCol">whether the content can be found from cache</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L221">framework/web/widgets/COutputCache.php#221</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">getIsContentCached</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_contentCached</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_contentCached</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_contentCached</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">checkContentCache</span><span style="color: #007700">();<br />}</span>
</span>
</code></div>
</div>
<p></p>


<div class="detailHeader" id="init-detail">
init()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>init</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L175">framework/web/widgets/COutputCache.php#175</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">init</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getIsContentCached</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">replayActions</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getCachingStack</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">push</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_start</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">ob_implicit_flush</span><span style="color: #007700">(</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Marks the start of content to be cached.
Content displayed after this method call and before <a href="COutputCache.html#endCache">endCache()</a>
will be captured and saved in cache.
This method does nothing if valid content is already found in cache.</p>


<div class="detailHeader" id="recordAction-detail">
recordAction()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>recordAction</b>(string $context, string $method, array $params)</div>
</td></tr>
<tr>
  <td class="paramNameCol">$context</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">a property name of the controller. The property should refer to an object
whose method is being recorded. If empty it means the controller itself.</td>
</tr>
<tr>
  <td class="paramNameCol">$method</td>
  <td class="paramTypeCol">string</td>
  <td class="paramDescCol">the method name</td>
</tr>
<tr>
  <td class="paramNameCol">$params</td>
  <td class="paramTypeCol">array</td>
  <td class="paramDescCol">parameters passed to the method</td>
</tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L332">framework/web/widgets/COutputCache.php#332</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">recordAction</span><span style="color: #007700">(</span><span style="color: #0000BB">$context</span><span style="color: #007700">,</span><span style="color: #0000BB">$method</span><span style="color: #007700">,</span><span style="color: #0000BB">$params</span><span style="color: #007700">)<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_actions</span><span style="color: #007700">[]=array(</span><span style="color: #0000BB">$context</span><span style="color: #007700">,</span><span style="color: #0000BB">$method</span><span style="color: #007700">,</span><span style="color: #0000BB">$params</span><span style="color: #007700">);<br />}</span>
</span>
</code></div>
</div>
<p>Records a method call when this output cache is in effect.
When the content is served from the output cache, the recorded
method will be re-invoked.</p>


<div class="detailHeader" id="replayActions-detail">
replayActions()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
protected void <b>replayActions</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L340">framework/web/widgets/COutputCache.php#340</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">protected&nbsp;function&nbsp;</span><span style="color: #0000BB">replayActions</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(empty(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_actions</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return;<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$controller</span><span style="color: #007700">=</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$cs</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">app</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getClientScript</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;foreach(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_actions&nbsp;</span><span style="color: #007700">as&nbsp;</span><span style="color: #0000BB">$action</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]===</span><span style="color: #DD0000">'clientScript'</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">=</span><span style="color: #0000BB">$cs</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]===</span><span style="color: #DD0000">''</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">=</span><span style="color: #0000BB">$controller</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$object</span><span style="color: #007700">=</span><span style="color: #0000BB">$controller</span><span style="color: #007700">-&gt;{</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]};<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">method_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$object</span><span style="color: #007700">,</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">call_user_func_array</span><span style="color: #007700">(array(</span><span style="color: #0000BB">$object</span><span style="color: #007700">,</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]),</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">]===</span><span style="color: #DD0000">''&nbsp;</span><span style="color: #007700">&amp;&amp;&nbsp;</span><span style="color: #0000BB">function_exists</span><span style="color: #007700">(</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">]))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">call_user_func_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">],</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">2</span><span style="color: #007700">]);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;throw&nbsp;new&nbsp;</span><span style="color: #0000BB">CException</span><span style="color: #007700">(</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">t</span><span style="color: #007700">(</span><span style="color: #DD0000">'yii'</span><span style="color: #007700">,</span><span style="color: #DD0000">'Unable&nbsp;to&nbsp;replay&nbsp;the&nbsp;action&nbsp;"{object}.{method}".&nbsp;The&nbsp;method&nbsp;does&nbsp;not&nbsp;exist.'</span><span style="color: #007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array(</span><span style="color: #DD0000">'object'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">0</span><span style="color: #007700">],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'method'</span><span style="color: #007700">=&gt;</span><span style="color: #0000BB">$action</span><span style="color: #007700">[</span><span style="color: #0000BB">1</span><span style="color: #007700">])));<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Replays the recorded method calls.</p>


<div class="detailHeader" id="run-detail">
run()
<span class="detailHeaderTag">
method
</span>
</div>

<table class="summaryTable">
<tr><td colspan="3">
<div class="signature2">
public void <b>run</b>()</div>
</td></tr>
</table>

<div class="sourceCode">
<b>Source Code:</b> <a class="sourceLink" href="https://github.com/yiisoft/yii/blob/1.1.17/framework/web/widgets/COutputCache.php#L193">framework/web/widgets/COutputCache.php#193</a> (<b><a href="#" class="show">show</a></b>)
<div class="code"><code><span style="color: #000000">
<span style="color: #0000BB"></span><span style="color: #007700">public&nbsp;function&nbsp;</span><span style="color: #0000BB">run</span><span style="color: #007700">()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getIsContentCached</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">isCachingStackEmpty</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">processDynamicOutput</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;elseif(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">!==</span><span style="color: #0000BB">null</span><span style="color: #007700">)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">=</span><span style="color: #0000BB">ob_get_clean</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getCachingStack</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">pop</span><span style="color: #007700">();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$data</span><span style="color: #007700">=array(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_actions</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">is_array</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dependency</span><span style="color: #007700">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dependency</span><span style="color: #007700">=</span><span style="color: #0000BB">Yii</span><span style="color: #007700">::</span><span style="color: #0000BB">createComponent</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dependency</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_cache</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">set</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCacheKey</span><span style="color: #007700">(),</span><span style="color: #0000BB">$data</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">duration</span><span style="color: #007700">,</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">dependency</span><span style="color: #007700">);<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">isCachingStackEmpty</span><span style="color: #007700">())<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getController</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">processDynamicOutput</span><span style="color: #007700">(</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">_content</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</span>
</span>
</code></div>
</div>
<p>Marks the end of content to be cached.
Content displayed before this method call and after <a href="COutputCache.html#init">init()</a>
will be captured and saved in cache.
This method does nothing if valid content is already found in cache.</p>


</div><!-- end of content -->

<div id="apiFooter">
&copy; 2008-2013 by <a href="http://www.yiisoft.com">Yii Software LLC</a><br/>
All Rights Reserved.<br/>
</div><!-- end of footer -->

<script type="text/javascript">
/*<![CDATA[*/
$("a.toggle").toggle(function(){
	$(this).text($(this).text().replace(/Hide/,'Show'));
	$(this).parents(".summary").find(".inherited").hide();
},function(){
	$(this).text($(this).text().replace(/Show/,'Hide'));
	$(this).parents(".summary").find(".inherited").show();
});
$(".sourceCode a.show").toggle(function(){
	$(this).text($(this).text().replace(/show/,'hide'));
	$(this).parents(".sourceCode").find("div.code").show();
},function(){
	$(this).text($(this).text().replace(/hide/,'show'));
	$(this).parents(".sourceCode").find("div.code").hide();
});
$("a.sourceLink").click(function(){
	$(this).attr('target','_blank');
});
/*]]>*/
</script>

</div><!-- end of page -->
</body>
</html>